﻿<navigation:Page x:Class="anael.Home" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
    xmlns:local="clr-namespace:anael"
    Title="Home"
    Style="{StaticResource PageStyle}">

    
    
    <Grid x:Name="LayoutRoot">
        <Grid.Resources>

            <local:ImageFromFBUriConverter x:Key="imageFromFBUriConverter" />
            <Style x:Key="friendItemStyle" TargetType="ListBoxItem">
                <Setter Property="Template">
                    <Setter.Value>
                        <StackPanel Orientation="Horizontal" Height="50" Background="Yellow">
                            <Border BorderBrush="Blue" BorderThickness="3">
                            <Image x:Name="ProfilePicture" 
                                   Width="50" Height="50"
                                   Stretch="None" 
                                   HorizontalAlignment="Left" 
                                   VerticalAlignment="Top"

                                   Source="{Binding Path=Picture}"
                                   />
                            </Border>
                            
                            <TextBlock x:Name="name" Text="{Binding Path=Name}"/>
                        </StackPanel>
                    </Setter.Value>
                </Setter>
            </Style>

            <DataTemplate x:Key="friendItemDataTemplate">
       
                        <StackPanel Orientation="Horizontal" Height="50" Background="Yellow">
                    <ContentPresenter Content="{Binding Path=Picture, Converter={StaticResource imageFromFBUriConverter}}"/>
                            <Image x:Name="ProfilePictureData" 
                                   Stretch="None" 
                                   HorizontalAlignment="Left" 
                                   VerticalAlignment="Top"
                                   Source="{Binding Path=Image}"
                                   />
                            <TextBlock x:Name="txtblockName" Text="{Binding Path=Name}"/>
                        </StackPanel>
                 
            </DataTemplate>
        </Grid.Resources>
        <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}">

            <StackPanel x:Name="ContentStackPanel">

                <Image x:Name="ProfileImage" />
                
                
                <TextBlock x:Name="HeaderText" Style="{StaticResource HeaderTextStyle}" 
                                   Text="Home"/>
                <TextBlock x:Name="ContentText" Style="{StaticResource ContentTextStyle}" 
                                   Text="Home page content"/>

                <Button Height="40" HorizontalAlignment="Left" Margin="250,30,0,0" Name="fbLogin" Style="{StaticResource FacebookButtonStyle}" Content="Connexion via Facebook" VerticalAlignment="Top" Width="200" Click="fbLogin_Click" />

                <ListBox x:Name="friendList" ItemTemplate="{StaticResource friendItemDataTemplate}" SelectionChanged="friendList_SelectionChanged">
                </ListBox>

                <WebBrowser Height="207" HorizontalAlignment="Left" Margin="12,88,0,0" Name="webBrowser1" VerticalAlignment="Top" Width="676" Visibility="Collapsed" />
                <sdk:Label Height="28" HorizontalAlignment="Left" Margin="12,343,0,0" Name="label1" VerticalAlignment="Top" Width="676" />

            </StackPanel>

        </ScrollViewer>
    </Grid>

</navigation:Page>